<script setup>
import { setToken } from '@/utils/auth'
import { onMounted } from 'vue'
const { proxy } = getCurrentInstance()

onMounted(() => {
  const token = proxy.$route.query && proxy.$route.query.token
  setToken(token)
  const redirect = proxy.$route.query && proxy.$route.query.redirect
  proxy.$router.push({ path: redirect || '/' }).catch(() => {})
})
</script>
